<template>
  <div class="container">
    <common-head></common-head>
    <div class="title">
      <p>信息上报</p>
    </div>
    <div class="abnormal-device-container">
      <div class="device-info">
        <van-cell title="上报内容描述：" />
        <van-field
          v-model="description"
          rows="4"
          autosize
          type="textarea"
          placeholder="请输入"
          show-word-limit
        />
        <div class="foot">
          <van-button
            type="primary"
            color="#2f6fe2"
            size="mini"
            class="foot-button"
            @click="goBack"
            >取消</van-button
          >
          <van-button
            type="primary"
            color="#2f6fe2"
            size="mini"
            class="foot-button"
            @click="confirmSubmit"
            >确认上报</van-button
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import commonHead from "../../components/xc/commonHead.vue";
export default {
  components: {
    commonHead
  },
  data() {
    return {
      description: ""
    };
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    confirmSubmit() {
      // 确认处理逻辑
      this.$dialog
        .confirm({
          title: "上报信息确认",
          message: "确定要上报信息吗？",
          confirmButtonColor: "#ee0a24"
        })
        .then(() => {
          this.baseService
            .post("/user-center/sys/bizUser/reportProblem", {
              description: this.description
            })
            .then(res => {})
            .catch(err => {});
        })
        .catch(err => {
          console.log("取消上报---->");
        });
    }
  }
};
</script>

<style scoped>
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.title {
  margin: 10px;
  font-weight: 700;
}

.abnormal-device-container {
  background-color: #f5f5f5;
  height: 100vh;
  width: 98%;
  padding-left: 2%;
}

.device-info {
  background-color: #e6f2ff;
  margin-top: 0.2rem;
  border-radius: 0.2rem;
}

.confirm-btn {
  margin-top: 1rem;
  padding: 0 1rem;
}
.foot {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin: 16px 0px;
}
.foot-button {
  padding: 14px 0px;
  border-radius: 5px;
  margin-top: 20px;
  color: white;
}
.van-button--primary {
  width: 100px;
}
a,
body,
div,
html,
i,
img,
input,
li,
p,
select,
span,
textarea,
ul {
  font-size: 12px;
}

/deep/ .van-cell {
  background-color: transparent;
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.1); */
}

/deep/ .van-field__body {
  background-color: white;
  border-radius: 0.1rem;
  padding: 0.5rem;
}

/deep/ .van-button--primary {
  background-color: #4080ff;
  border-color: #4080ff;
  border-radius: 0.1rem;
  width: 100%;
  margin-top: 0.2rem;
}
</style>
